close all; clear all; path(pathdef); clc;

% add subfunctions
addpath(genpath('subfunctions/'))
addpath(genpath('data_suppinfo/'))

% color library
color_list{1} = [67 84 147]/255;        % dark blue
color_list{2} = [110 153 201]/255;      % light blue
color_list{3} = [196 40 27]/255;        % dark red
color_list{4} = [218 134 121]/255;      % light red
color_list{5} = [40 127 70]/255;        % dark green
color_list{6} = [161 196 139]/255;      % light green
color_list{7} = [218 165 32]/255;       % gold
color_list{8} = [238 221 130]/255;      % light gold
color_list{9} = [128 0 128]/255;        % purple
color_list{10} = [204 153 255]/255;     % light purple
color_list{11} = [161 165 162]/255;     % grey

%% tracking result

FontSize = 12;

%%% data list as a function of laser power %%%
% data = load('HeatScanData-2017-10-18_22-06-52/gResultData.mat'); % dead embryo
data = load('HeatGradientData-2017-11-29_22-57-40/gResultData.mat'); % live embryo

fh = figure(1); cla()
set(fh, 'position', [100 100 [180 200]])
vol2pos = 0.0081;

t_pos   = data.gTrackData(:,1);
x_pos   = data.gTrackData(:,2)/vol2pos;
y_pos   = data.gTrackData(:,3)/vol2pos;
z_pos   = data.gTrackData(:,4);

t_fl    = data.gTrackCount(:,1);
y_fl    = data.gTrackCount(:,2);

plot(t_pos, x_pos-x_pos(1), '-','linewidth', 1.5)
hold on
plot(t_pos, y_pos-y_pos(1), '-','linewidth', 1.5)
plot(t_pos, z_pos-z_pos(1), '-','linewidth', 1.5)
axisinfo('Time (min)', 'Position (\mum)', [0 max(t_pos)], [-3], FontSize)

set(gca, 'YTick', [-4 0 4 8])
set(gca, 'YTick', [-3 0 3 6])




